/**  
 * @Title: ForwardBlogAdapter.java
 * @Package com.tydic.weibo.module.message
 * @Description: 自定义转发、评论适配器
 * @author wzx
 * @date 2011-10-25 下午02:47:19
 * @version V1.0  
 */
package org.ufinity.hsms.module.device.adapter;

import java.util.ArrayList;

import org.ufinity.hsms.R;
import org.ufinity.hsms.common.adapter.MyBaseAdapter;
import org.ufinity.hsms.module.device.entity.ItemEntity;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * 
 * @Description
 * @author 钱新才
 */
public class ItemAdapter extends MyBaseAdapter {

	private static final String TAG = "ItemAdapter";


	public ItemAdapter(Activity activity) {
		super();
		// 初始化
		this.activity = activity;
		items = new ArrayList();
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view;
		final ViewHolder holder;
		if (convertView == null || convertView.getTag() == null) {
			LayoutInflater lf = LayoutInflater.from(activity);
			view = lf.inflate(R.layout.device_list_item, null);

			holder = new ViewHolder();
			holder.txt_title = (TextView) view.findViewById(R.id.txt_title);
			view.setTag(holder);
		} else {
			view = convertView;
			holder = (ViewHolder) view.getTag();
		}
		ItemEntity h = (ItemEntity) items.get(position);
		holder.txt_title.setText(h.getItemDesc());
		return view;
	}

	class ViewHolder {
		TextView txt_title;
	}

}
